<?php

namespace App\Models\Factory;

use App\Models\AbsModelFactory;
use App\Models\Admin\AdminUser;
use App\Models\Orm\Delivery;
use Illuminate\Support\Facades\Log;



/**
 * 安稳号后台用户操作工厂方法
 * Class AdminFactory
 * @package App\Models\Factory
 */
class AdminFactory extends AbsModelFactory
{

    /**
     * 获取后台用户所对应的渠道
     * @param $admin_user_id
     * @return array
     */
    public static function getChannelByAdminUserId($admin_user_id)
    {
        $channel = Delivery::where('admin_user_id',$admin_user_id)->get()->toArray();
        return $channel ? : [];
    }


    /**
     * 通过后台用户id获取用户
     * @param $admin_user_id
     * @return array
     */
    public static function getAdminUserById($admin_user_id)
    {
        $admin  = AdminUser::where('id',$admin_user_id)->get()->toArray();
        return $admin ? : [];
    }

}
